package top.zywork.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.zywork.dao.GoodsSeckillDAO;
import top.zywork.dos.GoodsSeckillDO;
import top.zywork.dto.GoodsSeckillDTO;
import top.zywork.service.AbstractBaseService;
import top.zywork.service.GoodsSeckillService;

import javax.annotation.PostConstruct;

/**
 * GoodsSeckillServiceImpl服务接口实现类<br/>
 *
 * 创建于2019-07-24<br/>
 *
 * @author http://zywork.top 王振宇
 * @version 1.0
 */
@Service(value = "goodsSeckillService")
public class GoodsSeckillServiceImpl extends AbstractBaseService implements GoodsSeckillService {

    private GoodsSeckillDAO goodsSeckillDAO;

    @Autowired
    public void setGoodsSeckillDAO(GoodsSeckillDAO goodsSeckillDAO) {
        super.setBaseDAO(goodsSeckillDAO);
        this.goodsSeckillDAO = goodsSeckillDAO;
    }

    @PostConstruct
    public void init() {
        super.init(GoodsSeckillDO.class, GoodsSeckillDTO.class);
    }

    @Override
    public int updateActiveByOtherId(Long shopId, Long goodsId, Long goodsSkuId, byte isActive) {
        return goodsSeckillDAO.updateActiveByOtherId(shopId, goodsId, goodsSkuId, isActive);
    }
}
